﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using Windows.UI.Xaml.Media.Imaging;

namespace FindAnything.OpenAPI
{

    public sealed partial class ItemDetailView : Page
    {
        Item item;

        public ItemDetailView()
        {
            this.InitializeComponent();
        }

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            /*
                       private String get_Name;        // 습득품목명
                       private String title;           // 습득물 분류
                       private String get_Date;        // 습득일자
                       private String take_Place;      // 수령가능장소
                       private String contact;         // 수령가능장소 연락처
                       private String cate;            // 습득물분류
                       private String get_Position;    // 습득위치, 회사명
                       private String get_Place;       // 습득 위치
                       private String get_Thing;       // 습득물 상세정보
                       private String status;          // 습득물 상태


             */

            this.item = (Item)e.Parameter;
            BitmapImage bi = new BitmapImage();
            if (this.item.IMG_URL == null)
            {
                
            }
            else
            {
                bi.UriSource = new Uri(this.item.IMG_URL);
            }
            img.Source = bi;
            desc.Text = "습득품목명 : " + this.item.NAME + "\r\n습득일자 : " + this.item.GET_DATE
                        + "\r\n습득위치 : " + this.item.GET_PLACE
                        + "\r\n습득물 상세정보 : " + this.item.GET_THING + "\r\n\r\n수령가능 장소 : " + this.item.TAKE_PLACE
                        + "\r\n해당 연락처 : " + this.item.CONTACT;

        }

        private void backButton_Click(object sender, RoutedEventArgs e)
        {

            if (this.Frame != null && this.Frame.CanGoBack) this.Frame.GoBack();
        }

    }
}
